﻿<%@ Page Language="C#" MasterPageFile="~/ShopAdmin/Site.Master" AutoEventWireup="true" CodeBehind="groupadd.aspx.cs" Inherits="VK.Casemeet.Web.ShopAdmin.Groups.groupadd" %>
<%@ Import Namespace="VK.Comm" %>

<asp:Content ID="Content1" ContentPlaceHolderID="contentHead" runat="server">
    <link rel="stylesheet" type="text/css" href="/Kindeditor/themes/default/default.css" />
    <link rel="stylesheet" type="text/css" href="/Kindeditor/plugins/code/prettify.css" />
    <script type="text/javascript" charset="utf-8" src="/Kindeditor/kindeditor-min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Kindeditor/lang/zh_CN.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Kindeditor/plugins/code/prettify.js"></script>
    <script type="text/javascript" src="/Scripts/ajaxupload.js"></script>
    
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentBody" runat="server">

<script type="text/javascript">
    function butsubmit() {
        if (validator.form() == false) {
            return false;
        }
        else {
            if ($("#hidFouceImgUrl").val() == "") {
                alert("请先上传团购焦点图");
                return false;
            }
        }

    }
    //        KindEditor.ready(function (K) {
    //            var editor4 = K.create('#txtContent', {
    //                cssPath: '/Kindeditor/plugins/code/prettify.css',
    //                uploadJson: '/PageHandler/UploadJson.ashx',
    //                fileManagerJson: '/PageHandler/FileManagerJson.ashx',
    //                resizeType: 1,
    //                allowFileManager: false,
    //                allowImageUpload: false,
    //                items: ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
    //						'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
    //						'insertunorderedlist', '|', 'emoticons', 'link'],
    //                afterCreate: function () {
    //                    var self = this;
    //                    K.ctrl(document, 13, function () {
    //                        self.sync();
    //                        K('form[id=mainForm]')[0].submit();
    //                    });
    //                    K.ctrl(self.edit.doc, 13, function () {
    //                        self.sync();
    //                        K('form[id=mainForm]')[0].submit();
    //                    });
    //                    $('.butSave').click(function () {
    //                        self.sync();
    //                    });
    //                }
    //            });
            
        
      </script>

    <div class="bodyContent divBody">
        <div class="divDetailOper">
            <asp:LinkButton ID="butSave" runat="server" CssClass="butSave" onclick="butSave_Click" OnClientClick="return butsubmit()">保存信息</asp:LinkButton>
            <a class="butBack" href="grouplist.aspx">返回列表</a>
        </div>
        <div class="left" style="width:74%;margin:10px 0 0 1%;_margin:10px 0 0 0.5%;height:auto;">
            <div class="divEdit" style="width:100%;">
                <div class="title">基本信息</div>
                <div class="content">
                    <table cellpadding="0" cellspacing="0" class="tableLeftEdit">
                    <tbody>
                        <tr>
                            <th>标题：</th>
                            <td><asp:TextBox ID="txtTitle" runat="server" CssClass="inputText required" Width="80%"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <th>团购价格：</th>
                            <td>
                                 <asp:TextBox ID="txtPrice" runat="server" CssClass="inputText required number" Width="11%"></asp:TextBox>元</td>
                        </tr>
                        <tr>
                            <th>原价：</th>
                            <td>
                                <asp:TextBox ID="txtDiscount" runat="server" CssClass="inputText required number" Width="11%"></asp:TextBox>
                            </td>
                        </tr>
                       
                        <tr>
                            <th>报名结止时间：</th>
                            <td><input id="txtTimes" name="txtTimes"  class="inputText required"  onclick="return showCalendar(this.id, 'y-m-d')"/>天</td>
                        </tr>
                        <tr>
                            <th>产品类别：</th>
                            <td>
                                <asp:DropDownList runat="server" ID="txtprocType" Width="11%"> </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <th>团购内容：</th>
                            <td><textarea id="txtContent"  runat="server" name="txtContent" 
                                    style="width:100%;height:200px;"></textarea></td>
                        </tr>
                    </tbody>
                    </table>
                </div>
            </div>
            <div style="text-align:center;">
            <div class="divEdit martop10" style="width:550px;padding-bottom:20px; margin-left:300px;">
                <div class="title">
                    <p class="contenta">团购焦点图</p>
                    <p class="contentb"><span class="padlef20" style="color:Red;"></span><a href="#" id="butImgUrl" style="color:#1d3d83;">【点我上传图片】</a></p>
                    <input id="hidFouceImgUrl" name="hidFouceImgUrl" type="hidden"  />
                    <script type="text/javascript">
                        $(document).ready(function () {
                            var button = $('#butImgUrl'), interval;
                            new AjaxUpload(button, {
                                action: '',
                                onSubmit: function (file, ext) {
                                    if (!(ext && /^(jpg|png|jpeg|gif)$/.test(ext))) {
                                        alert('错误:图片格式不正确!');
                                        return false;
                                    }
                                    if ($("#imgArea").children("div").length >= 1) {
                                        alert('图片上传限制1张');
                                        return false;
                                    }
                                    this._settings.action = '/PageHandler/UpLoadFile.ashx?folderName=Photos/';
                                    this._settings.data = { oldFileName: $('#divImgUrl img').attr('src') };
                                    this.disable();
                                    var tips = $("#butImgUrl").prev();
                                    tips.html("文件上传中请等待");
                                    interval = window.setInterval(function () {
                                        if (tips.html().length < 20) {
                                            tips.html(tips.html() + ">");
                                        } else {
                                            tips.html('文件上传中请等待');
                                        }
                                    }, 300);
                                },
                                onComplete: function (file, response) {
                                    $("#butImgUrl").prev().html('');
                                    window.clearInterval(interval);
                                    this.enable();
                                    window.clearInterval(interval);
                                    var jsondata = JSON.parse(response);
                                    if (jsondata.Error.length == 0) {
                                        $("#imgArea").append("<div style='float:left;width:145px;height:130px;border:1px solid #eaeaea;background:#f5f5f5;margin:10px 0 0 10px;'>" +
                                        "<img alt='' src='/UserImages/Photos/" + jsondata.FileName + "' style='width:139px;height:100px;padding:3px;'/>" +
                                        "<p class='sj10 hg22 txtlef hand' onclick='$(this).parent().remove()'>删除</p></div>");
                                        $("#hidFouceImgUrl").val("/UserImages/Photos/" + jsondata.FileName)
                                    } else {
                                        alert(jsondata.Error);
                                    }
                                }
                            });
                        });
                    </script>
                </div>
                <div id="imgArea" class="content">
                    
                </div>
            </div>
            </div>
        </div>
        <div class="left" style="width:23%;margin:10px 0 0 1%;_margin:10px 0 0 0.5%;height:auto;">
            <div class="divEdit" style="width:100%;">
                <div class="title">系统信息</div>
                <div class="content">
                    <table cellpadding="0" cellspacing="0" class="tableRightEdit">
                        <tbody>
                            <tr><th>编辑人：</th></tr>
                            <tr><td><asp:Label ID="lbEditor" runat="server" Text="管理员"></asp:Label></td></tr>
                           <%-- <tr><th>创建时间：</th></tr>
                            <tr><td><asp:TextBox ID="txtCreated" runat="server" CssClass="inputText" Width="80%" onclick="return showCalendar(this.id, 'y-m-d');"></asp:TextBox></td></tr>
                            <tr><th>点击：</th></tr>
                            <tr><td><asp:TextBox ID="txtHits" runat="server" CssClass="inputText digits" Width="80%" Text="0"></asp:TextBox></td></tr>--%>
                            <tr><th>启用：</th></tr>
                            <tr><td><asp:CheckBox ID="chkIsEnable" runat="server" Checked="true" /></td></tr>
                           
                         </tbody>
                    </table>
                </div>
            </div>
            <%--<div class="divEdit martop10" style="width:100%;">
                <div class="title">出发时间</div>
                <div id="divSchedule" class="content lineSchedule">
                    <div style="background-color:#f0f8ff;height:28px;line-height:28px;">
                        <p class="left" style="width:35%">出发日期</p>
                        <p class="left" style="width:35%">截止日期</p>
                    </div>
                    <div class="clear" style="padding:8px 5px 0 10px;background-color:#f1f7f7;height:30px;margin:5px 0px 0 0px;">
                        <input id="txtDeparture" name="txtDeparture" type="text" class="left inputText txtcen" style="width:35%" onclick="return showCalendar(this.id, 'y-m-d');" />
                        <input id="txtClosing" name="txtClosing" type="text" class="left inputText txtcen" style="width:35%" onclick="return showCalendar(this.id, 'y-m-d');" />
                        <div class='left tableOperNew' onclick='AddItem(this);'>&nbsp;添加</div>
                    </div>
                </div>
                <input id="hidScheduleArray" name="hidScheduleArray" type="hidden" />
            </div>--%>
        </div>
        <div class="clear f0" style="height:10px; width:100%"></div>
        <div class="clear f0" style="height:20px; width:100%"></div>
    </div>
</asp:Content>

